<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020\4\10 0010
 * Time: 14:03
 */

function short(){
    header('Content-Type: image/jpeg');
    $size=$_GET['size'];
    $url=$_GET['url'];
    if($size=='min'){
        $type=1;
    }elseif($size=='samll')
    {
        $type=2;
    }elseif($size=='large'){
        $type=3;
    }elseif($size=='xlarge'){
        $type=4;
    }
    $image=M('imageurl')->where("`url`='$url' and `type`=".$type)->find();
    $url=$image['imageurl'];
    $imageURL="http://23.106.155.200:94/Public/Uploads/$url";
    $image = @ImageCreateFromString(@file_get_contents($imageURL));
    if (is_resource($image) === true)
        imagejpeg($image);
    else
        echo "This image ain't quite cuttin it.";

}
?>